<template>
  <div class="row no-wrap q-gutter-sm">
    <el-select v-model="单项.数据范围">
      <!-- <el-option label="无资源权限" :value="0" /> -->
      <el-option label="仅本人" value="仅本人" />
      <el-option label="本部门不含下级" value="本部门不含下级" />
      <el-option label="本部门及下级部门" value="本部门及下级部门" />
      <el-option label="全部" value="全部" />
    </el-select>
    <el-button class="" type="primary" @click="保存">确 定</el-button>
  </div>
</template>

<script setup>
import { reactive } from 'vue';
import { updateAuthority } from '@/api/authority'
import * as util from "@/utils"

const props = defineProps({
  单项: {
    type: Object
  },
  authority: {
    default: function () {
      return []
    },
    type: Array
  }
})

// const 单项 = reactive({})
const { 单项 } = props
// 保存
const 保存 = async () => {
  const res = await updateAuthority(单项)
  if (res.code === 0) {
    // ElMessage({ type: 'success', message: '资源设置成功' })
    util.提示()
  }
}

</script>
